<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class api_test extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
	}

	public function site()
	{
		$url = site_url('sites/site_register');

		$params = array(
			'name' => '测试',
			'introduction' => '测试测试测试',
		);
		
		$result = curl_post($url, $params, 'array');
		$this->result_output($result);
	}

	public function result_output($result)
	{
		if (json_decode($result, TRUE)) {
			echo "<pre>";
			var_dump(json_decode($result, TRUE));
			echo "</pre>";
		} else {
			echo $result;
		}
	}

}
